#!/usr/bin/python

import Image

im = Image.open("4.bmp")
pix = im.load()

vectors = []

for x in range(im.size[0]):
  for y in range(im.size[1]):
    if pix[x,y] == (0,255,0):
      vectors.append([x,y])
      
out = '{{0,0}'
      
for i in range(len(vectors)-1):
  out += ',{%d,%d}' % (vectors[i+1][0]-vectors[i][0], vectors[i+1][1]-vectors[i][1])
  
out += '}'

print 'len:%d' % len(vectors)

print out
  
    
